#{extends 'logged_user.html' /}
#{set title:'Comment that you received' /}
<h3>Comment that you received</h3>

<table>
    <th>Title</th>
    <th>Offerer</th>
    <th>Requester</th>
	<th>Commenter</th>
	<th>Date</th>
	<th></th>
	#{list items:notificationItems, as:'notificationItem'}
    <tr>
      #{if notificationItem.comment.handshake.checkOriginallyAnOffer}
      <td>${notificationItem.comment.handshake.offer.title}</td>
      #{/if}
      #{else}
      <td>${notificationItem.comment.handshake.request.title}</td>
      #{/else}
      <td>${notificationItem.comment.handshake.offer.user.fullname}</td>
      <td>${notificationItem.comment.handshake.request.user.fullname}</td>
	  
	  <td>
	  #{if notificationItem.user.id == notificationItem.comment.handshake.offer.user.id }
	  ${notificationItem.comment.handshake.request.user.fullname}
	  #{/if}
	  #{elseif notificationItem.user.id  == notificationItem.comment.handshake.request.user.id}
	  ${notificationItem.comment.handshake.offer.user.fullname}
	  #{/elseif}
	  </td>
	  <td>${notificationItem.comment.date.format('dd MMMM yyyy')}</td>
      <td><a href="@{Handshakes.show(notificationItem.comment.handshake.id)}">Handshake Details</a></td>
    </tr>
	<tr>
	<td colspan="6">
	<font color="red">Comment Text:</font>${notificationItem.comment.text}
	</td>
	</tr>
	   #{/list}
  </table>
  

